package com.example.picturestorage.aTest;

import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Arrays;

public class Client {

    public void f1(){
        System.out.println(112233);
    }

    public static void main(String[] args) throws NoSuchFieldException, NoSuchMethodException, InvocationTargetException, IllegalAccessException {
        Customer customer = new Customer(BehaviorEnum.QUEUE_UP);
        Customer customer2 = new Customer(BehaviorEnum.QUEUE_UP);
        Customer customer3 = new Customer(BehaviorEnum.GET_NUMER);
        Customer customer4 = new Customer(BehaviorEnum.GET_NUMER);
        WindowService windowService = new WindowService(customer);
        WindowService windowService2 = new WindowService(customer2);
        WindowService windowService3 = new WindowService(customer3);
        WindowService windowService4 = new WindowService(customer4);
        Class<BehaviorEnum> behaviorEnumClass = BehaviorEnum.class;
        Constructor<?>[] constructors = behaviorEnumClass.getConstructors();
        System.out.println("constructors = " + Arrays.toString(constructors));
        Constructor<?>[] declaredConstructors = behaviorEnumClass.getDeclaredConstructors();
        System.out.println("declaredConstructors = " + Arrays.toString(declaredConstructors));
        Field[] fields = behaviorEnumClass.getFields();
        Field[] declaredFields = behaviorEnumClass.getDeclaredFields();
        System.out.println("fields = " + Arrays.toString(fields));
        System.out.println("declaredFields = " + Arrays.toString(declaredFields));
//        Field name = behaviorEnumClass.getDeclaredField("name");
//        System.out.println("name = " + name);
//        Constructor<BehaviorEnum> declaredConstructor = behaviorEnumClass.getDeclaredConstructor(String.class, int.class);
//        System.out.println("declaredConstructor = " + declaredConstructor);
        Class<Client> clientClass = Client.class;
        Method method = clientClass.getMethod("f1");
        Client client = new Client();
        Object invoke = method.invoke(client);
        System.out.println("invoke = " + invoke);

    }

}
